//
//  DMBannerScenes.m
//  DualMediationSDK
//
//  Created by YeJary on 2025/1/15.
//

#import "DMBannerScenes.h"

#pragma mark - Banner场景常量定义

// 主要Banner场景
NSString * const SCENE_BANNER_INIT = @"SCENE_BANNER_INIT";
NSString * const SCENE_BANNER_LEVEL_ENTER = @"SCENE_BANNER_LEVEL_ENTER";
NSString * const SCENE_BANNER_LEVEL_WIN = @"SCENE_BANNER_LEVEL_WIN";
NSString * const SCENE_BANNER_SHOP = @"SCENE_BANNER_SHOP";

// 其他Banner场景
NSString * const SCENE_BANNER_LEVEL_FAIL = @"SCENE_BANNER_LEVEL_FAIL";
NSString * const SCENE_BANNER_GAME_PAUSE = @"SCENE_BANNER_GAME_PAUSE";
NSString * const SCENE_BANNER_MAIN_MENU = @"SCENE_BANNER_MAIN_MENU";
NSString * const SCENE_BANNER_SETTINGS = @"SCENE_BANNER_SETTINGS";

@implementation DMBannerScenes

+ (NSArray<NSString *> *)allBannerScenes {
    return @[
        SCENE_BANNER_INIT,
        SCENE_BANNER_LEVEL_ENTER,
        SCENE_BANNER_LEVEL_WIN,
        SCENE_BANNER_SHOP,
        SCENE_BANNER_LEVEL_FAIL,
        SCENE_BANNER_GAME_PAUSE,
        SCENE_BANNER_MAIN_MENU,
        SCENE_BANNER_SETTINGS
    ];
}

+ (BOOL)isValidBannerScene:(NSString *)scene {
    if (!scene) return NO;
    
    NSArray *validScenes = [self allBannerScenes];
    return [validScenes containsObject:scene];
}

+ (NSString *)displayNameForScene:(NSString *)scene {
    if (!scene) return @"未知场景";
    
    static NSDictionary *displayNames = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        displayNames = @{
            SCENE_BANNER_INIT: @"游戏主页",
            SCENE_BANNER_LEVEL_ENTER: @"关卡进入",
            SCENE_BANNER_LEVEL_WIN: @"关卡胜利",
            SCENE_BANNER_SHOP: @"商店页面",
            SCENE_BANNER_LEVEL_FAIL: @"关卡失败",
            SCENE_BANNER_GAME_PAUSE: @"游戏暂停",
            SCENE_BANNER_MAIN_MENU: @"主菜单",
            SCENE_BANNER_SETTINGS: @"设置页面"
        };
    });
    
    NSString *displayName = displayNames[scene];
    return displayName ?: [NSString stringWithFormat:@"未知场景(%@)", scene];
}

@end